package com.qunar.wan.web.controller;

import com.qunar.wan.common_api.service.CacheService;
import com.qunar.wan.web.controller.common.AbstractController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * User: hangyu.shen Date: 13-12-2 Time: 下午3:25
 */
@Controller
@RequestMapping("classify")
public class ClassifyController extends AbstractController {
    @Resource
    private CacheService cacheService;

    /**
     * 返回所有的大分类活动及其对应的子分类活动类别信息
     */
    @RequestMapping("/allClassifyData")
    @ResponseBody
    public Object getSubAndClassifyData() {
        long start = System.currentTimeMillis();
        List<Object> data = cacheService.readAllClassisfiesCache();
        return dataJson(data, System.currentTimeMillis() - start);
    }
}
